package com.example.shiro_demo.ctrl;

import com.example.shiro_demo.server.RoleService;
import com.example.shiro_demo.vo.AddOrUpdateRoleReqVO;
import com.example.shiro_demo.vo.BaseResponse;
import com.example.shiro_demo.vo.UpdateRoleReqVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private RoleService roleService;

    @PostMapping("/update")
    public BaseResponse update(@RequestBody UpdateRoleReqVO vo) {
        return roleService.update(vo);
    }
    @PostMapping("/add")
    public BaseResponse addRole(@RequestBody AddOrUpdateRoleReqVO vo) {
        return roleService.addRole(vo);
    }
}
